//
//  UIImage+tool.m
//  MiTu
//
//  Created by CY on 15/11/12.
//  Copyright © 2015年 CY. All rights reserved.
//

#import "UIImage+tool.h"

@implementation UIImage (tool)

+ (UIImage *)imageWithColor:(UIColor *)aColor
{
    CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [aColor CGColor]);
    CGContextFillRect(context, rect);
    UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return theImage;
}

@end
